<?php
include $this->admin_tpl('header','admin');
?>
<div class="pad_10">
<form action="?m=<?=$_GET['m']?>&c=<?=$_GET['c']?>&a=<?=$_GET['a']?>&pid=<?=$_GET['pid']?>&list_pid=<?=$listpid?>" method="post" name="myform" id="myform" enctype="multipart/form-data">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
		<input type="hidden" name="submit" id="" value="dosubmit">
		<input type="hidden" name="id" id="" value="<?=$info['id']?>">
	<tr>
		<th width="100">上级分类</th>
		<td>
			<select name="info[pid]">
				<?=$sort_tree?>
			</select>
		</td>
	</tr>
	<tr>
		<th width="100">url</th>
		<td>
			<input type="text" name="info[url]" id="url" size="100" class="input-text" value="<?=$info['url']?>">
		</td>
	</tr>
	<tr>
		<th width="100">名称</th>
		<td><input type="text" maxlength="100" name="info[classname]" id="classname" size="100" class="input-text" value="<?=stripcslashes($info['classname'])?>"></td>
	</tr>
	<tr>
		<th width="100">短标签:</th>
		<td>
			<input type="text" name="info[short_name]" id="short_name" size="30" class="input-text" value="<?=$info['short_name']?>">
		</td>
	</tr>
	<?php if($_GET['j_id'] != ''){?>
	<tr>
		<th width="100">数据规则</th>
		<td>
			<input type="button" onClick="adddata();" name="search" id="search" class="mybutton btnblue small" value="添加数据规则">
		</td>
	</tr>
	<?php }?>
	<tr>
		<th width="100">图片:</th>
		<td><input type="text" name="info[img_url]" id="img_url" size="30" class="input-text" value="<?=isset($info['img_url'])?$info['img_url']:''?>">
			<input type="file" name="img_url" value="">
		</td>
	</tr>
	<tr>
		<th width="100">排序:</th>
		<td>
			<input type="text" name="info[order_id]" size="30" class="input-text" value="<?=isset($info['order_id'])?$info['order_id']:'1'?>">
		</td>
	</tr>
	<tr>
		<th width="100">关联集子ID:</th>
		<td>
			<input type="text" name="info[relate_j_id]" size="30" class="input-text" value="<?=isset($info['relate_j_id'])?$info['relate_j_id']:''?>">
		</td>
	</tr>
 	<tr>
		<th width="100">使用模板:</th>
		<td>
			<select  name="info[used_template]" id="is_display" style="width:150px;" >
				<?php foreach($template_list as $val){?>
			<option <?php if($val == $info['used_template']){echo "selected=selected";}?> value="<?=$val?>"><?=$val?></option>
				<?php }?>
			</select>
		</td>
	</tr>
<!-- 	<input type="hidden"  name="info[attr]"  id="rules_hid" class="input-text" value="<?=isset($info['attr'])?$info['attr']:''?>"> -->
	<tr>
		<th width="100">是否显示:</th>
		<td>
			<select  name="info[is_display]" id="is_display" style="width:150px;" >
			<option <?php if($info['is_display'] == '1'){echo "selected=selected";}?> value="1">显示</option>
			<option <?php if($info['is_display'] == '0'){echo "selected=selected";}?> value= "0">不显示</option>
			</select>
		</td>
	</tr>
	<tr>
		<th width="100">数据规则:<p style="color:red">**不要修改这里面的数据</p></th>

		<td>
			<textarea name="info[attr]" rows="10" cols="50"  class="input-text" id="rules"><?=htmlspecialchars_decode($info['attr'])?></textarea>
		</td>
	</tr>
	<tr>
		<th width="100"></th>
		<td>
		<input type="submit" name="dosubmit" id="dosubmit" class="mybutton btnblue" value="确定">
		<input type="reset" name="dosubmit" id="dosubmit" class="mybutton btnblue" value="重置">
		</td>
	</tr>

</table>
</form>
</div>
<script type="text/javascript">
function adddata() {
	window.open('?m=tmall_zhekou&c=tmall_items&a=init&j_id=<?=$_GET['id']?>&pc_hash=<?=$_GET['pc_hash']?>','添加数据','height=auto,width=1000,top=100,left=400,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=yes, status=no');
}
function fillcontent(res){
	//alert(res);
	$('#rules').val($('#rules').val()+'|'+res);
	$('#rules_hid').val($('#rules_hid').val()+'|'+res);
};
</script>
</body>
</html>